<div class="form">
<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
	'id'=>'karyawan-form',
	'enableAjaxValidation'=>true,
        'method'=>'post',
	'type'=>'horizontal',
	'htmlOptions'=>array(
		'enctype'=>'multipart/form-data'
	)
)); ?>
     	<fieldset>
		<legend>
			<p class="note">Fields with <span class="required">*</span> are required.</p>
		</legend>

	<?php echo $form->errorSummary($model,'Opps!!!', null,array('class'=>'alert alert-error span12')); ?>
        		
   <div class="control-group">		
		<div class="span4" style="width:100%">
			<div class="formSidel">
				<?php echo $form->textFieldRow($model,'nip',array('class'=>'span5','maxlength'=>45)); ?>
				<?php echo $form->textFieldRow($model,'nama',array('class'=>'span5','maxlength'=>45)); ?>
				<div class="control-group">
					
					<?php 
					if($model->tgl_lahir!='')$model->tgl_lahir = date("d/m/Y",strtotime($model->tgl_lahir ));
					echo $form->labelEx($model,'tgl_lahir',array('class'=>'control-label')); ?>
					<div class="controls">
					<?php
					$this->widget('zii.widgets.jui.CJuiDatePicker', array(
						'model'=>$model,
						'attribute'=>'tgl_lahir',
						'htmlOptions'=>array(
							'class'=>'span5'
						),
						'options'=>array(
							'dateFormat'=>'dd/mm/yy',
							'showAnim'=>'slide',
							'changeMonth'=>true,
							'changeYear'=>true,
						), 
					));
					?>
					<?php echo $form->error($model,'tgl_lahir'); ?>
					</div>
				</div>
				<?php echo $form->textFieldRow($model,'tempat_lahir',array('class'=>'span5','maxlength'=>20)); ?>
				<?php echo $form->dropDownListRow($model,'jenis_kelamin',array('1' => 'Laki-Laki', '2' => 'Perempuan'),array('class'=>'span5','empty'=>'Jenis Kelamin')); ?>
				<?php echo $form->dropDownListRow($model,'id_type_dinas',CHtml::listData(TypeDinas::model()->findAll(), 'id_type_dinas', 'nama_type_dinas'),array('class'=>'span5','empty'=>'Select Type Dinas')); ?>
				<?php echo $form->dropDownListRow($model,'id_agama',CHtml::listData(Agama::model()->findAll(), 'id_agama', 'agama'),array('class'=>'span5','empty'=>'Select Agama')); ?>
				<?php echo $form->dropDownListRow($model,'id_jabatan',CHtml::listData(Jabatan::model()->findAll(), 'id_jabatan', 'nama_jabatan'),array('class'=>'span5','empty'=>'Select Jabatan')); ?>
				<?php echo $form->dropDownListRow($model,'id_golongan',CHtml::listData(Golongan::model()->findAll(), 'id_golongan', 'nama_golongan'),array('class'=>'span5','empty'=>'Select Golongan')); ?>
			</div>
			<div class="formSider">
				<?php echo $form->dropDownListRow($model,'stat_pernikahan',array('1' => 'Menikah', '2' => 'Belum Menikah'),array('class'=>'span5','empty'=>'Marital Status')); ?>
				<?php echo $form->textAreaRow($model,'alamat',array('rows'=>6, 'cols'=>50, 'class'=>'span8')); ?>
				<?php echo $form->textFieldRow($model,'no_telp',array('class'=>'span5','maxlength'=>20)); ?>
				<?php echo $form->textFieldRow($model,'npwp',array('class'=>'span5','maxlength'=>45)); ?>
				<?php echo $form->textFieldRow($model,'pen_terakhir',array('class'=>'span5','maxlength'=>45)); ?>
				<div class="control-group">
					<?php if($model->tgl_mulai_kerja!='')$model->tgl_mulai_kerja = date("d/m/Y",strtotime($model->tgl_mulai_kerja ));
					echo $form->labelEx($model,'tgl_mulai_kerja',array('class'=>'control-label')); ?>
					<div class="controls">
					<?php
					$this->widget('zii.widgets.jui.CJuiDatePicker', array(
						'model'=>$model,
						'attribute'=>'tgl_mulai_kerja',
						'htmlOptions'=>array(
							'class'=>'span5'
						),
						'options'=>array(
							'dateFormat'=>'dd/mm/yy',
							'showAnim'=>'slide',
							'changeMonth'=>true,
							'changeYear'=>true,
						), 
					));
					?>
					<?php echo $form->error($model,'tgl_mulai_kerja'); ?>
					</div>
				</div>
				<div class="control-group">
					<?php  if($model->tg_keluar_kerja!='')$model->tg_keluar_kerja = date("d/m/Y",strtotime($model->tg_keluar_kerja ));
					echo $form->labelEx($model,'tg_keluar_kerja',array('class'=>'control-label')); ?>
					<div class="controls">
					<?php
					$this->widget('zii.widgets.jui.CJuiDatePicker', array(
						'model'=>$model,
						'attribute'=>'tg_keluar_kerja',
						'htmlOptions'=>array(
							'class'=>'span5'
						),
						'options'=>array(
							'dateFormat'=>'dd/mm/yy',
							'showAnim'=>'slide',
							'changeMonth'=>true,
							'changeYear'=>true,
						), 
					));
					?>
					<?php echo $form->error($model,'tg_keluar_kerja'); ?>
					</div>
				</div>
			</div>
         </div>   
  </div>
	
	<div class="form-actions" >
			<?php $this->widget('bootstrap.widgets.TbButton', array(
				'buttonType'=>'submit',
				'type'=>'primary',
							'icon'=>'ok white',  
				'label'=>$model->isNewRecord ? 'Create' : 'Save',
			)); ?>
				  <?php $this->widget('bootstrap.widgets.TbButton', array(
				'buttonType'=>'reset',
							'icon'=>'remove',  
				'label'=>'Reset',
			)); ?>
	</div>
</fieldset>

<?php $this->endWidget(); ?>

</div>
